package tk.deep.domain.biz.odr;

import tk.deep.domain.biz.addr.DeliveryAddress;
import tk.deep.entity.CodeEntity;
import tk.deep.domain.biz.user.User;

import java.util.Date;
import java.util.List;

/**
 * Created by boot on 8/13/15.
 * <p>
 * 订单对象 *
 * <p>
 * surplus part
 */
public class Order extends CodeEntity {


    // 创建时间
    private Date createTime;

    // 如果有多次支付的情况下，每次支付都会修改此时间
    private Date payTime;


    // 订单订单参加活动
    private Long PromoteId;


    // the user which the order belongs to.
    private User user;

    // 订单明细项目
    private List<OrderItem> orderItems;

    //
    private DeliveryAddress address;

    //增加订单明细项目
    public void addOrderItem(OrderItem orderItem) {

    }

    // remove fm OrderItem list.
    public void removeOrderItem(OrderItem orderItem) {

    }

    /**
     * @param items
     * @return
     */
    public static List<OrderItem> Parse(String items) {
        List<OrderItem> lst = null;

        return lst;
    }

    /**
     * 订单明细串化，编码后订单明细项目就是购物车的内容。
     *
     * @param items
     * @return
     */
    public static String stringfy(List<OrderItem> items) {
        String rtn = null;
        if (items != null) {

        }
        return rtn;
    }


    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getPayTime() {
        return payTime;
    }

    public void setPayTime(Date payTime) {
        this.payTime = payTime;
    }

    public Long getPromoteId() {
        return PromoteId;
    }

    public void setPromoteId(Long promoteId) {
        PromoteId = promoteId;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<OrderItem> getOrderItems() {
        return orderItems;
    }

    public void setOrderItems(List<OrderItem> orderItems) {
        this.orderItems = orderItems;
    }

    public DeliveryAddress getAddress() {
        return address;
    }

    public void setAddress(DeliveryAddress address) {
        this.address = address;
    }
}
